<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSetMealsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('set_meals', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->integer('store_id')->index()->nullable()->comment('门店ID');
            $table->integer('type')->index()->default(1)->comment('套餐类型：1.永久套餐、2.周期套餐、3.限时套餐');
            $table->integer('cycle_type')->index()->default(1)->comment('周期类型：1.工作日、2.周六日、3.每月、4.每年');
            $table->string('cycle_time',255)->nullable()->comment('周期时间：每月格式.06、每年格式.03-28');
            $table->string('name',255)->index()->nullable()->comment('套餐名称');
            $table->string('describe', 255)->nullable()->comment('套餐描述');
            $table->integer('start_time')->index()->default(0)->comment('开始时间戳');
            $table->integer('end_time')->index()->default(0)->comment('结束时间戳');
            $table->text('images_url')->nullable()->comment('图片url');
            $table->integer('price')->index()->default(0)->comment('套餐价格：单位是分');
            $table->integer('time')->index()->default(0)->comment('套餐时间：单位是秒');
            $table->integer('status')->index()->default(1)->comment('状态：1.正常，2.禁用');
            $table->engine = 'InnoDB';
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('set_meals');
    }
}
